label: Fix mnemonic activation
authorMatthias Clasen <mclasen@redhat.com>
Sun, 23 May 2021 14:23:08 +0000 (10:23 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 23 May 2021 15:19:40 +0000 (11:19 -0400)
The intention of the code is to find a focusable ancestor,
so it needs to look at the focusable property, not at
can-focus. This is a change from GTK 3, where can-focus
was the correct property to look at.

Fixes: #3965
gtk/gtklabel.c

index d75c7caf2c7a8e9e5803f2f6ba1ee4c3cdbdc6b4..68ab7fc18c67214c85b9196b80482e5d12fb8732 100644 (file)
@@ -1930,7 +1930,7 @@ gtk_label_mnemonic_activate (GtkWidget *widget,
 
   while (parent)
     {
-      if (gtk_widget_get_can_focus (parent) ||
+      if (gtk_widget_get_focusable (parent) ||
           (!group_cycling && gtk_widget_can_activate (parent)) ||
           GTK_IS_NOTEBOOK (gtk_widget_get_parent (parent)))
         return gtk_widget_mnemonic_activate (parent, group_cycling);